import React, { Suspense } from "react";
import ReactDOM from "react-dom/client";
import "./index.css";
import { BrowserRouter } from "react-router-dom";
import reportWebVitals from "./reportWebVitals";
import Router from "./router";
import "lib-flexible";
import dayjs from 'dayjs'
 import GoEasy from 'goeasy'
import 'dayjs/locale/zh-cn' // ES 2015 
//聊天室
// 在使用 window.goEasy 之前添加这一行
declare global {
  interface Window {
    goEasy: any;
  }
}


const goEasy = GoEasy.getInstance({
  host: 'hangzhou.goeasy.io',//应用所在的区域地址: 【hangzhou.goeasy.io |singapore.goeasy.io】
  appkey: 'BC-3924448716aa4bb4ac4d1b949214b3b0',
  modules: ['pubsub'],
});

window.goEasy=goEasy
dayjs.locale('zh-cn')

const root = ReactDOM.createRoot(
  document.getElementById("root") as HTMLElement
);

root.render(
  <Suspense>
    <BrowserRouter>
        <Router></Router>
    </BrowserRouter>
  </Suspense>
);

// If you want to start measuring performance in your app, pass a function
// to log results (for example: reportWebVitals(console.log))
// or send to an analytics endpoint. Learn more: https://bit.ly/CRA-vitals
reportWebVitals();
